home *** CD-ROM | disk | FTP | other *** search
-
- /*
- There may be additional include files required depending
- upon the compile product you are using. Typical compilers
- include Microsoft C by Microsoft or Turbo C by Boland Int'l.
- */
- #include <stdio.h>
- struct temp{
- int at;
- int bt;
- };
- main()
- {
- struct temp test,test2;
- test.at=5; test.bt=10;
- test2=test; /* allowed ONLY by ANSI C compilers */
-
- test2.at=test.at; /* this way legal for both */
- test2.bt=test.bt;
- access(test);
- printf("%d %d\n",test.at, test.bt );
- }
- /* receive a copy of a structure */
- access(v)
- struct temp v;
- {
- printf("%d %d\n",v.at, v.bt );
- v.at=100; v.bt=200;
- printf("%d %d\n",v.at, v.bt );
- }
-